<template>
  <div class="content-form">
    <Form :model="form" :label-width="110" class="register-page">
      <Row>
        <Col span="8">
          <FormItem label="证件类型" prop="AAC058">
            <Select v-model="form.aac058" placeholder="请选择类型" style="width:280px">
              <Option v-for="item in CertificatesList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="公民证件号码" prop="AAC002">
            <Input v-model="form.aac002" placeholder="证件号码" style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="发证日期" prop="AAC200">
            <DatePicker type="date" placeholder="请选择日期" v-model="form.acc0mh" style="width:280px" @on-change="time"></DatePicker>
          </FormItem>
        </Col>
      </Row>
      <Row>
        <Col span="8">
          <FormItem label="姓名" prop="AAC003">
            <Input v-model="form.aac003" placeholder="请输入姓名" style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="性别" prop="AAC004">
            <Select v-model="form.aac004" placeholder="请选择类型" style="width:280px">
              <Option v-for="item in SexList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="民族" prop="AAC005">
            <Select v-model="form.aac005" placeholder="请选择类型" style="width:280px">
              <Option v-for="item in NationList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
      </Row>
      <Row>
        <Col span="8">
          <FormItem label="出生日期" prop="AAC006">
            <DatePicker type="date" placeholder="请选择日期" v-model="form.aac006" style="width:280px" @on-change="time"></DatePicker>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="学历" prop="AAC011">
            <Select v-model="form.aac011" placeholder="请选择学历" style="width:280px">
              <Option v-for="item in EducationList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="婚姻状况" prop="AAC017">
            <Select v-model="form.aac017" placeholder="请选择婚姻" style="width:280px">
              <Option v-for="item in MarriageList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
      </Row>
      <Row>
        <Col span="8">
          <FormItem label="政治面貌" prop="AAC024">
            <Select v-model="form.aac024" placeholder="请选择政治面貌" style="width:280px">
              <Option v-for="item in PoliticalOutlookList" :value="item.value" :key="item.value">{{ item.label}}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="身体状况" prop="AAC033">
            <Select v-model="form.aac033" placeholder="请选择" style="width:280px">
              <Option v-for="item in PhysicalConditionList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="户口性质" prop="AAC009">
            <Select v-model="form.aac009" placeholder="请选择" style="width:280px">
              <Option v-for="item in RegisteredList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
      </Row>
      <Row>
        <Col span="8">
          <FormItem label="户口所在地名称" prop="AAC010">
            <Input v-model="form.aac010" placeholder="请输入户口所在地" style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="户口所在地区" prop="AAB299">
            <Select v-model="form.aab299" placeholder="请选择状态" @on-open-change="Permanent" style="width:280px">
              <Option v-for="item in PermanentList" :value="item.id" :key="item.id">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="户口登记日期" prop="AAC186">
            <DatePicker type="date" placeholder="请选择日期" v-model="form.aac186" style="width:280px"  @on-change="time"></DatePicker>
          </FormItem>
        </Col>
      </Row>
      <Row>
        <Col span="8">
          <FormItem label="常住地址区" prop="AAC046">
            <Select v-model="form.aac046" placeholder="请选择状态" @on-open-change="Permanent" style="width:280px">
              <Option v-for="item in PermanentList" :value="item.id" :key="item.id">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="常住地址名称" prop="BAB305">
            <Input v-model="form.bab305" placeholder="请输入常住地址" style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="登记就失业状态" prop="ACC0M3">
            <Select v-model="form.acc0m3" placeholder="请选择状态" style="width:280px">
              <Option v-for="item in StateList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
      </Row>
      <Row>
        <Col span="8">
          <FormItem label="毕业学校" prop="AAC180">
            <Input v-model="form.aac180" placeholder="请输入毕业学校" style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="毕业日期" prop="AAC181">
            <DatePicker type="date" placeholder="请选择日期" v-model="form.aac181" style="width:280px"  @on-change="time"></DatePicker>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="毕业院校" prop="AAC181">
            <Select v-model="form.acc0m4" placeholder="请选择毕业院校所在地类型" style="width:280px">
              <Option v-for="item in graduationList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>

      </Row>
      <Row class="mb20">

        <Col span="8" class="ivu-form-item-content">
          <FormItem label="所学专业" prop="AAC181">
            <Select v-model="form.aac183" placeholder="请选择专业" @on-open-change="major" style="width:280px">
              <Option v-for="item in majorList" :value="item.id" :key="item.id">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8" class="ivu-form-item-content">
          <FormItem label="所学专业名称" prop="AAC181">
            <Input v-model="form.acc0m8" placeholder="请输入专业名称" style="width:280px"></Input>
          </FormItem>
        </Col>
<!--        <Col span="8">-->
<!--          <FormItem label="国家职业资格名称" prop="AAC181">-->
<!--            <Input v-model="form.acc0m5" placeholder="请输入职业资格名称" style="width:280px"></Input>-->
<!--          </FormItem>-->
<!--        </Col>-->
      </Row>
      <Row class="mb20">
        <Col span="8">
          <FormItem label="国家职业资格等级" prop="AAC181">
            <Select v-model="form.aac015" placeholder="请选择等级" style="width:280px">
              <Option v-for="item in GradeList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="国家职业资格名称" prop="AAC181">
            <Input v-model="form.acc0m5" placeholder="请输入职业资格名称" style="width:280px"></Input>
          </FormItem>
        </Col>

        <Col span="8" >
          <FormItem label="职业资格代码" prop="AAC181">
            <Select v-model="form.aca111" @on-open-change="Occupation" style="width:280px" placeholder="取得职业（工种）资格代码">
              <Option v-for="item in OccupationList" :value="item.aca111" :key="item.aca111">{{ item.aca112 }}</Option>
            </Select>
          </FormItem>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" >
          <FormItem label="职业资格名称" prop="AAC181">
            <Input v-model="form.acc0mz" placeholder="请输入取得职业（工种）资格名称"  style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8" >
          <FormItem label="取得职业资格日期" prop="AAC181">
            <DatePicker type="date" placeholder="请选择日期" v-model="form.aac184" style="width: 280px"  @on-change="time"></DatePicker>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="首次就业时间" prop="AAC200">
            <DatePicker type="date" placeholder="请选择日期" v-model="form.aac185" style="width:280px"  @on-change="time"></DatePicker>
          </FormItem>
        </Col>
      <!--  <Col span="8">
          <FormItem label="专业技术职务级别" prop="AAC014">
            <Select v-model="form.aac014" placeholder="请选择专业" style="width:280px">
              <Option v-for="item in levelList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="专业技术职务" prop="AAC200">
            <Select v-model="form.acc0aa" style="width:280px">
              <Option v-for="item in technologyList" :value="item.value" :key="item.value">{{ item.label}}</Option>
            </Select>
          </FormItem>
        </Col>-->
      </Row>
    <!--  <Row>
        <Col span="8">
          <FormItem label="专业技术职务名称" prop="ACC0AA">
            <Select v-model="form.aac200" style="width:280px">
              <Option v-for="item in technologyList" :value="item.value" :key="item.value">{{ item.label}}</Option>
            </Select>
           &lt;!&ndash; <Input v-model="form.aac200" placeholder="请输入专业技术职务名称" style="width:280px"></Input>&ndash;&gt;
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="取得专技资格日期" prop="AAC007">
            <DatePicker type="date" placeholder="请选择日期" v-model="form.aac007" style="width:280px"  @on-change="time"></DatePicker>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="首次就业时间" prop="AAC200">
            <DatePicker type="date" placeholder="请选择日期" v-model="form.aac185" style="width:280px"  @on-change="time"></DatePicker>
          </FormItem>
        </Col>
      </Row>-->
      <Row>
        <!--        <Col span="8">-->
        <!--        <FormItem label="是否享受社保补贴" prop="AAC200" style="width:280px">-->
        <Col span="3">是否享受社保补贴</Col>
        <Col span="5">
          <RadioGroup v-model="form.acc0m6" >
            <Radio label="1">是</Radio>
            <Radio label="0">否</Radio>
          </RadioGroup>
        </Col>
        <!--   </FormItem>
           </Col>-->
        <!--        <Col span="8">-->
        <!--        <FormItem label="是否就业困难人员" prop="AAC200">-->
        <Col span="3">是否就业困难人员</Col>
        <Col span="5">
          <RadioGroup v-model="form.acc0m7" style="width:280px">
            <Radio label="1">是</Radio>
            <Radio label="0">否</Radio>
          </RadioGroup>
        </Col>
        <!--        </FormItem>-->
        <!--        </Col>-->
        <Col span="8" >
          <FormItem label="就业困难人员类别" prop="AAC200">
            <Select v-model="form.adc310" style="width:280px">
              <Option v-for="item in categoryList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
      </Row>
      <Row class="mb20">
        <!-- <Col span="8">-->
        <!-- <FormItem label="是否领过再就业优惠证" prop="AAC200" >-->
        <Col span="3">
          是否领过再就业优惠证
        </Col>
        <Col span="5">
          <RadioGroup v-model="form.acc0m9" style="width:280px">
            <Radio label="1">是</Radio>
            <Radio label="0">否</Radio>
          </RadioGroup>
        </Col>
        <!--   </FormItem>-->
        <!--  </Col>-->
        <Col span="8" >
          <FormItem label="再就业优惠证号" prop="AAC200">
            <Input v-model="form.acc0ma" placeholder="请输入" style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="参加社会保险种类" prop="AAC200">
            <Select v-model="form.acc0mb" style="width:280px">
              <Option v-for="item in insuranceList" :value="item.value" :key="item.value">{{ item.label }}</Option>
            </Select>
          </FormItem>
        </Col>
      </Row>
      <Row class="mb20">
        <!-- <Col span="8">
         <FormItem label="是否领取过失业证" prop="AAC200">-->
        <Col span="3">是否领取过失业证</Col>
        <Col span="5">
          <RadioGroup v-model="form.acc0mc" style="width:280px">
            <Radio label="1">是</Radio>
            <Radio label="0">否</Radio>
          </RadioGroup>
        </Col>
        <!--        </FormItem>-->
        <!--        </Col>-->
        <Col span="8" >
          <FormItem label="失业证号码" prop="AAC200">
            <Input v-model="form.acc0md" placeholder="请输入" style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8" >
          <FormItem label="培训意愿" prop="AAC200">
            <Input v-model="form.acc0mf" type="textarea" placeholder="请输入" style="width:280px"></Input>
          </FormItem>
        </Col>
      </Row>
      <Row class="mb20">
        <!--     <Col span="8" >
             <FormItem label="是否有就业愿望" prop="AAC200">-->
        <Col span="3">是否有就业愿望</Col>
        <Col span="5">
          <RadioGroup v-model="form.acc0me" style="width:280px">
            <Radio label="1">是</Radio>
            <Radio label="0">否</Radio>
          </RadioGroup>
        </Col>
        <!--        </FormItem>-->
        <!--        </Col>-->
        <Col span="8" >
          <FormItem label="手机号码" prop="AAC200">
            <Input v-model="form.aac067" placeholder="请输入手机号" style="width:280px"></Input>
          </FormItem>
        </Col>
        <Col span="8" >
          <FormItem label="微信、QQ、电子邮箱联系方式" prop="AAC200">
            <Input v-model="form.aae005" placeholder="请输入" style="width:280px"></Input>
          </FormItem>
        </Col>
      </Row>
      <Row class="mb20">
        <Col span="8" >
          <FormItem label="上传照片" prop="AAC200">
           <!-- <div class="demo-upload-list" v-for="item in uploadList" :key="item.size">
              <img :src="item.url">
              <div class="demo-upload-list-cover">
                <Icon type="ios-eye-outline" @click.native="handleView(item.url)"></Icon>
                <Icon type="ios-trash-outline" @click.native="handleRemove(item)"></Icon>
              </div>
            </div>-->
          <img :src="form.acc0mg" width="70px">
            <div style="width: 100px;height: 100px;">
              <Upload
                ref="upload"
                :show-upload-list="false"
                type="drag"
                action="http://120.27.63.37:38081/api/ac/file/fileCommonService/upLoadFiles"
                start-date="2019-10-13"
                :before-upload="beforeUpload"
                style="display: inline-block;width:58px;">
                <div style="width: 58px;height:58px;line-height: 58px;">
                  <Icon type="ios-camera" size="20"></Icon>
                </div>
              </Upload>
              <Modal title="View Image" v-model="visible">
                <img :src="url" v-if="visible" style="width: 100%">
              </Modal>
            </div>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="备注" prop="AAE013">
            <Input v-model="form.aae013" placeholder="请输入" type="textarea" style="width:280px"></Input>
          </FormItem>
        </Col>
      </Row>
    </Form>
  </div>
</template>

<script>
import itemdata from '../itemdata'
import { date2str } from '@/api/eventlist'
import { createPost } from '@/api/post'
import { createUpLoadFiles, getSign } from '@/api/common'
export default {
  name: 'HandleCertificate',
  props: {
    type: Object,
    default: () => {
      return {}
    },
    unemploymentItem1: Object,
    info: Object,
    personinfo: Object,
    cardno: String
  },
  data () {
    return {
      upPicData: {
        fileName: '',
        userid: '',
        order_code: '',
        list: ''
      },
      url: '',
      infos: {},
      form: {
        apiName: 'sq4jycyz',
        aac058: '',
        aac002: '',
        aac003: '',
        aac004: '',
        aac005: '',
        aac006: '',
        aac011: '',
        aac017: '',
        aac024: '',
        aac033: '',
        aac009: '',
        aac010: '',
        aab299: '',
        aac186: '',
        aac046: '',
        bab305: '',
        acc0m3: '',
        aac180: '',
        aac181: '',
        aac183: '',
        acc0m8: '',
        acc0m4: '',
        acc0m5: '',
        aac015: '',
        aac184: '',
        aca111: '',
        acc0mz: '',
        aac014: '',
        aac200: '',
        acc0aa: '',
        aac185: '',
        aac007: '',
        acc0m6: '',
        acc0m9: '',
        acc0ma: '',
        acc0mb: '',
        acc0mc: '',
        acc0md: '',
        acc0me: '',
        acc0mf: '',
        aac067: '',
        aae005: '',
        acc0mh: '',
        aae013: '',
        acc0m7: '',
        adc310: '',
        acc0mg: '',
        aae011: '',
        aae017: '',
        aae019: '',
        aae020: '',
        aae022: ''
      },
      CertificatesList: itemdata.certificatesList,
      SexList: itemdata.sexList,
      NationList: itemdata.nationList,
      EducationList: itemdata.educationList,
      MarriageList: itemdata.marriageList,
      PoliticalOutlookList: itemdata.politicalOutlookList,
      PhysicalConditionList: itemdata.physicalConditionList,
      RegisteredList: itemdata.registeredList,
      StateList: itemdata.employmentStateList,
      majorList: [],
      graduationList: itemdata.graduationList,
      OccupationList: [],
      levelList: itemdata.technologyLevelList,
      categoryList: itemdata.categoryList,
      insuranceList: itemdata.insuranceList,
      uploadList: [],
      LocationList: [],
      PermanentList: [],
      OccupationNameList: [],
      technologyList: [], // 表单页面暂未使用
      GradeList: itemdata.gradeList,
      areaList: [],
      visible: false
    }
  },
  methods: {
    // 上传图片前转base64
    beforeUpload (file) {
      this.upPicData.fileName = '办理就业创业证' + '.' + file.type.substring(6)
      let that = this
      const reader = new FileReader()
      reader.readAsDataURL(file)
      reader.onload = () => {
        let index = reader.result.indexOf('base64,') + 7
        that.upPicData.file = reader.result.substring(index)
        that.upPicData.filePath = 'itemorder/' + that.info.userid + '/' + that.info.order_code
        console.log(that.upPicData)
        that.upPic(that.upPicData)
      }
      return false
    },
    // 上传图片
    upPic (obj) {
      console.log(obj, 'fasdf')
      var time = new Date().getTime()
      this.timeStep = time.toString()
      let param = {
        filePath: obj.filePath,
        fileName: obj.fileName,
        timestamp: this.timeStep
      }
      getSign(param).then(res => {
        if (res.data.errcode === 0) {
          createUpLoadFiles(res.data.data.docking_url, { sign: res.data.data.sign, timestamp: this.timeStep, filePath: obj.filePath, fileName: obj.fileName, file: obj.file }).then(res => {
            if (res.data.errcode === 0) {
              let imgurl = res.data.data
              console.log(imgurl, 'resssss')
              this.form.acc0mg = imgurl
              this.url = imgurl
              this.uploadList.push(imgurl)
              console.log(this.uploadList)
            } else {
              this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
            }
          })
        } else {
          this.$Notice.error({ title: '上传失败', desc: res.data.data.msg })
        }
      })
    },
    time () {
      this.form.aac006 = date2str(this.form.aac006)
      this.form.aac007 = date2str(this.form.aac007)
      this.form.aac181 = date2str(this.form.aac181)
      this.form.aac184 = date2str(this.form.aac184)
      this.form.aac185 = date2str(this.form.aac185)
      this.form.aac186 = date2str(this.form.aac186)
      this.form.acc0mh = date2str(this.form.acc0mh)
    },
    test () {
      let reg = /(^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)/
      if (this.form.aac058 === undefined || this.form.aac058 === '') {
        this.$Notice.error({ title: '请选择证件类型', desc: '' })
        return false
      } else if (reg.test(this.form.aac002) === false) {
        this.$Notice.error({ title: '输入身份证号不合法', desc: '' })
        return false
      } else if (!this.form.aac003) {
        this.$Notice.error({ title: '输入姓名', desc: '' })
        return false
      } else if (!this.form.aac004) {
        this.$Notice.error({ title: '请选择性别', desc: '' })
        return false
      } else if (!this.form.aac005) {
        this.$Notice.error({ title: '请选择民族', desc: '' })
        return false
      } else if (!this.form.aac006) {
        this.$Notice.error({ title: '请选择出生日期', desc: '' })
        return false
      } else if (!this.form.aac011) {
        this.$Notice.error({ title: '请选择学历', desc: '' })
        return false
      } else if (!this.form.aac017) {
        this.$Notice.error({ title: '请选择婚姻状况', desc: '' })
        return false
      } else if (!this.form.aac024) {
        this.$Notice.error({ title: '请选择政治面貌', desc: '' })
        return false
      } else if (!this.form.aac033) {
        this.$Notice.error({ title: '请选择身体状况', desc: '' })
        return false
      } else if (!this.form.aac009) {
        this.$Notice.error({ title: '请选择户口性质', desc: '' })
        return false
      } else if (!this.form.aac010) {
        this.$Notice.error({ title: '请输入户口所在地', desc: '' })
        return false
      } else if (!this.form.aac186) {
        this.$Notice.error({ title: '请选择户口登记日期', desc: '' })
        return false
      } else if (!this.form.aac046) {
        this.$Notice.error({ title: '请选择常住地址区域', desc: '' })
        return false
      } else if (!this.form.bab305) {
        this.$Notice.error({ title: '请输入常住地址', desc: '' })
        return false
      } else if (!this.form.acc0m3) {
        this.$Notice.error({ title: '请选择登记就业失业状态', desc: '' })
        return false
      } else if (!this.form.acc0mh) {
        this.$Notice.error({ title: '请选择发证日期', desc: '' })
        return false
      } else if (!this.form.acc0mg) {
        this.$Notice.error({ title: '请上传照片', desc: '' })
        return false
      } else if (!this.form.acc0m7) {
        this.$Notice.error({ title: '清选择是否就业困难', desc: '' })
        return false
      }

      if (this.form.aac011 === '10' || this.form.aac011 === '11' || this.form.aac011 === '14' || this.form.aac011 === '21' || this.form.aac011 === '31') {
        if (!this.form.aac180) {
          this.$Notice.error({ title: '请输入毕业学校', desc: '' })
          return false
        } else if (!this.form.aac181) {
          this.$Notice.error({ title: '请选择毕业日期', desc: '' })
          return false
        } else if (!this.form.aac183) {
          this.$Notice.error({ title: '请选择专业', desc: '' })
          return false
        } else if (!this.form.acc0m8) {
          this.$Notice.error({ title: '请输入专业名称', desc: '' })
          return false
        } /* else if (!this.form.acc0m4) {
          this.$Notice.error({ title: '毕业院校所在地类型', desc: '' })
          return false
        } */
      }

      if (this.form.acc0m7 === '1') {
        if (!this.form.adc310) {
          this.$Notice.error({ title: '请选择就业困难人员类别', desc: '' })
        }
      }
      this.$emit('form', this.form)
    },
    // 所学专业
    major () {
      let param = {
        apiName: 'sq4zycode'
      }
      createPost(param).then(ret => {
        if (ret.data.data.result === '1') {
          this.majorList = ret.data.data.data
        }
      })
    },
    // 选择户口所在地编码
    location () {
      let param = {
        apiName: 'sq4areacode',
        queryid: '210100000000'
      }
      createPost(param).then(ret => {
        this.locationList = ret.data.data.data
        /*  if (ret.data.data.result === '1') {

            } else {
              this.$Message.error({
                title: '获取信息失败'
              })
            } */
      })
    },
    // 选择常住地区
    Permanent () {
      let param = {
        apiName: 'sq4areacode',
        queryid: '210100000000'
      }
      createPost(param).then(ret => {
        if (ret.data.data.result === '1') {
          this.PermanentList = ret.data.data.data
        }
      })
    },
    // 选择取得职业（工种）资格代码
    Occupation () {
      let param = {
        apiName: 'sq4gjzyfl'
      }
      createPost(param).then(ret => {
        if (ret.data.data.result === '1') {
          this.OccupationList = ret.data.data.data
        }
      })
    },
    area () {
      let param = {
        apiName: 'sq4areacode',
        queryid: '210100000000'
      }
      createPost(param).then(ret => {
        if (ret.data.data.result === '1') {
          this.areaList = ret.data.data.data
        }
      })
    },
    // 上传图片
    handleView (url) {
      this.url = url
      this.visible = true
    },
    handleRemove (file) {
      const fileList = this.uploadList
      this.uploadList.splice(fileList.indexOf(file), 1)
    }/*,
    handleSuccess () {
      /!* file.url = res.url
      file.name = res.title *!/
      // this.form.acc0mg = file.url
      // this.tupian = file.url
      this.uploadList.push(file)
      console.log(this.form.acc0mg, '2222222')
    } */
    /*   handleFormatError (file) {
        this.$Notice.warning({
          title: '文件格式不正确',
          desc: '文件格式' + file.name + ' 不正确,请选择jpg或png.'
        })
      },
      handleMaxSize (file) {
        this.$Notice.warning({
          title: '超出文件大小限制',
          desc: '文件  ' + file.name + ' 太大，不能超过2M.'
        })
      },
      handleBeforeUpload (file) {
        let that = this
        const reader = new FileReader()
        reader.readAsDataURL(file)
        reader.onload = () => {
          that.form.accomg = reader.result
          // let index = reader.result.indexOf('base64,') + 7
          // reader.result.substring(index)
        }
        console.log(that.form, '1121213')
        return false
      } */
  },
  mounted () {
    this.Occupation()
    this.major()
    this.Permanent()
    this.location()
    // console.log('@@@@@@@@' + this.personinfo.name)
    // let data = this.personinfo
    // this.form.aac002 = this.cardno
    // this.form.aac003 = data.name
    // // this.form.aac004 = data.sex
    // // this.form.aac005 = data.folk
    // this.form.bab305 = data.present_address
    // this.form.aac010 = data.address
  },
  watch: {
    unemploymentItem1 (a) {
      this.form = a
    },
    info (data) {
      this.infos = data
    },
    personinfo (a) {
      let data = a
      this.form.aac002 = this.cardno
      this.form.aac003 = data.name
      this.form.aac004 = data.sex
      this.form.aac005 = data.folk
      this.form.bab305 = data.present_address
      this.form.aac010 = data.address
      console.log(this.form.aac005)
    }

  }
}
</script>

<style scoped>
  .demo-upload-list{
    display: inline-block;
    width: 60px;
    height: 60px;
    text-align: center;
    line-height: 60px;
    border: 1px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    position: relative;
    box-shadow: 0 1px 1px rgba(0,0,0,.2);
    margin-right: 4px;
  }
  .demo-upload-list img{
    width: 100%;
    height: 100%;
  }
  .demo-upload-list-cover{
    display: none;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,.6);
  }
  .demo-upload-list:hover .demo-upload-list-cover{
    display: block;
  }
  .demo-upload-list-cover i{
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    margin: 0 2px;
  }
</style>
